home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_enter_hidden2.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  107 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_enter_hidden2.cog
  4. #
  5. # This cog causes 2 spiders to attack upon an entered message. One skitters down a web
  6. #
  7. # [CM]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. message    startup
  15. message    entered
  16.  
  17.  
  18. #............ACTORS..........
  19. thing    player                                    local
  20.  
  21. thing    spider0    
  22. thing    spider1                                        
  23.  
  24.  
  25. #............TRIGGERS..........
  26. sector    attack_sect
  27.  
  28.  
  29. #............AI MOVE TARGETS..........
  30. thing    spider0_mv0    
  31. thing    spider1_mv0    
  32.  
  33. thing    spiderhang                                local
  34.     
  35. #............TEMPLATES..........
  36. template    tpl_Spider=spider_wall                local
  37.  
  38. #............VARIABLES..........
  39. int        attacked=0                                local
  40.  
  41.  
  42. #............SOUNDS..........
  43. sound    attack_cue=mus_gen_danger2.wav            local
  44.  
  45.  
  46. end
  47. # ========================================================================================
  48.  
  49. code
  50.  
  51. startup:
  52.  
  53.     GetThingClassCog(spider1);
  54.     
  55.     # Pointer to Player...
  56.     player = GetLocalPlayerThing();
  57.  
  58.     # disable spiders
  59.     AISetCutSceneMode(spider0);
  60.     SetThingFlags(spider1, 0x80000);
  61.     
  62. return;
  63.  
  64. # ========================================================================================
  65. entered:
  66.  
  67. If ((GetSenderRef() == attack_sect) && (attacked == 0))
  68.     {
  69.     #print("spiders are attacking");
  70.     attacked = 1;
  71.     Sleep(0.5);
  72.     # danger cue
  73.     PlaySoundLocal(attack_cue, 0.5, 0.0, 0x0, 0);
  74.     
  75.     # spiders look at player
  76.     AISetLookThing(spider0, player);
  77.  
  78.     # spiders move toward player
  79.     AISetMoveSpeed(spider0, 1.0);
  80.     AISetMoveThing(spider0, spider0_mv0, 1);
  81.  
  82.     # spiders resume AI and attack
  83.     AIClearCutSceneMode(spider0);
  84.  
  85.     Sleep(1.0);
  86.     
  87.     
  88.     # create the ceiling drop spider
  89.     spiderhang = CreateThing(tpl_Spider, spider1);
  90.     
  91.     #sends message to spider_wall's class cog, saying "user0" (27)
  92.     SendMessageEx(GetThingClassCog(spiderhang), user0, spiderhang, 0, 0, 0);
  93.  
  94.     }
  95.  
  96.  
  97. return;
  98.  
  99.  
  100.  
  101. # ========================================================================================
  102. end
  103.  
  104.  
  105.  
  106.  
  107.